<template>
  <div class="overView">
    <!-- <el-card class="box-card"> -->
      <div class="content">
        <div class="item" @click="jump('customerManagement')">
          <img src="@/assets/image/overview/xjrw0.png" alt="">
          <div class="num">客户数量：{{customerCount}}</div>
        </div>
        <div class="item" @click="jump('potentialCustomers')">
          <img src="@/assets/image/overview/xjrw1.png" alt="">
          <div class="num">线索(潜在客户)数量：{{leadCount}}</div>
        </div>
        <div class="item" @click="jump('transactionManagement')">
          <img src="@/assets/image/overview/xjrw2.png" alt="">
          <div class="num">交易数量：{{tranCount}}</div>
        </div>
        <div class="item" @click="jump('transactionManagement')">
          <img src="@/assets/image/overview/xjrw5.png" alt="">
          <div class="num">成功交易数量：{{turnover}}</div>
        </div>
      </div>
    <!-- </el-card> -->
  </div>
</template>
<script>
export default {
  name: 'overView',
  data() {
    return {
      turnover: '',
      leadCount: '',
      customerCount: '',
      tranCount: '',
    }
  },
  methods: {
    jump(url) {
      this.$router.push({path:'/'+ url})
    },
    queryOverView() {
      this.$post(this.$api.common.overView,this.reqData('')).then(res => {
        if (res.data.code === 200) {
          let data = res.data.data;
          console.log(data);
          let {leadCount,customerCount,tranCount,turnover} = data
          this.leadCount = leadCount;
          this.customerCount = customerCount;
          this.tranCount = tranCount;
          this.turnover = tranCount;
        }
      })
    }

  },
  mounted() {
    this.queryOverView()
  }
}
</script>
<style lang="less" scoped>
.overView {
  // height: 100%;
  background: #fff;
  padding: 0.24rem;
  // overflow-y: scroll;
  .content {
    display: flex;
    justify-content: space-around;
    .item {
      padding: 0.15rem;
      box-shadow: 0rem 0rem 0.1rem rgba(0, 0, 0, 0.15);
      text-align: center;
      width: 20%;
      cursor: pointer;
      transition: all 0.3s;
      &:hover {
        transform: scale(1.08);
        box-shadow: 0rem 0rem 0.1rem rgba(0, 0, 0, 0.55);
      }
      img {
        height: 0.6rem;
      }
      .num {
        font-size: 0.2rem;
        margin-top: .1rem;
      }
    }
  }
}
</style>